<extend name="Public/base"/>

<block name="body">
<div class="main-title"><h2>{$meta_title}</h2></div>
<div class="columns-mod">
    <div class="hd cf">
      <h5>店铺名称：{$store['store_name']}</h5>
      <div class="title-opt">
      </div>
    </div>
 </div>
  
  <form id="form" action="{:U('saveSellCategory')}" method="post" class="form-horizontal">
    <div class="item-field">
      <div class="tab-content">
        <div class="tab-pane in tab0">
          <!-- 基本信息开始 -->
          <notempty name="list">
          <div class="form-item">
            <label class="item-label">店铺可发布商品类目表<span class="text-warning">（删除店铺的经营类目会造成相应商品下架，请谨慎操作）</span></label>
            <div class="controls">
              <div class="field-group">
                <table>
                  <thead>
                    <tr>
                      <th>分类1</th>
                      <th>分类2</th>
                      <th>分类3</th>
                      <!-- <th>佣金比例</th> -->
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                  <volist name="list" id="vo">
                    <tr>
                      <td>{$itemCategory[$vo['sell_cid_1']]|default=''}</td>
                      <td>{$itemCategory[$vo['sell_cid_2']]|default=''}</td>
                      <td>{$itemCategory[$vo['sell_cid_3']]|default=''}</td>
                      <!-- <td><input class="text input-small J_ajax_updatefield" data-action="{:U('setRate')}" data-id="{$vo['id']}" id="sell_cid_1" type="text" value="{$vo.rate}">%</td> -->
                      <td><a class="confirm ajax-get" title="删除" href="{:U('delSellCid',array('ids'=>$vo['id'],'store_id'=>$store['store_id']))}">[删除]</a></td>
                    </tr>
                  </volist>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
          </notempty>
          
          <div class="form-item cf">
            <label class="item-label">添加经营类目</label>
            <div class="controls" id="J_itemCategory">加载中...</div>
          </div>
          
          <!-- <div class="form-item">
            <label class="item-label">佣金比例<span class="text-danger">（必须为0-100的整数）</span></label>
            <div class="controls">
              <input type="text" class="text input-small" name="rate" value="0"> <span class="text-danger">%</span>
            </div>
          </div> -->
          
          
      <div class="form-item form-action cf">
        <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">添加</button>
        <a class="btn btn-return" href="javascript:history.go(-1);">返 回</a>
        <input type="hidden" name="store_id" value="{$store['store_id']|default=''}"/>
      </div>
    </div>
  </form>
</block>

<block name="script">
  <script src="__JS__/jquery/jquery.loadtype.js"></script>
  <script type="text/javascript">
    $(function(){
      //导航高亮
      onlyNum('rate');
      highlight_subnav("{:U('Store/index')}");
      
      //商品分类
      $('#J_itemCategory').loadtype({
        type: 'itemCategory',
        name1: 'cid_1',
        name2: 'cid_2',
        name3: 'cid_3'
      });
    });
  </script>
</block>